//
//  MIDIwinController.m
//  迷笛
//
//  Created by . on 2018/9/17.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIwinController.h"

@interface MIDIwinController ()
@property(nonatomic,strong)UIImageView * winimage;
@property(nonatomic,strong)UILabel * wintext;
@property(nonatomic,strong)UILabel * xqwin;
@property(nonatomic,strong)UIButton * check;
@property(nonatomic,strong)UILabel * time;

@end

@implementation MIDIwinController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor =[UIColor colorWithHexString:@"#1B212F"];
    UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:@selector(Block:)];
    self.navigationItem.leftBarButtonItem = leftBarItem;
    
    [self.navigationItem.leftBarButtonItem setImage:[[UIImage imageNamed:@"后退"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [self homeUI];
}
// 返回上一级
-(void)Block:(UIButton * )sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.translucent = NO;//Bar的模糊效果，默认为YES
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#171717"];
    self.title = @"支付成功";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFFFFF"],NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:WidthScale(17)]}];
    //    去掉导航黑线
    UIImage *img = [UIImage imageNamed:@""];
    [self.navigationController.navigationBar setBackgroundImage:img  forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
}
-(void)homeUI
{
    [self.view addSubview:self.winimage];
    [self.winimage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kDevice_Is_iPhoneX?WidthScale(134):WidthScale(86));
        make.centerX.equalTo(self.view);
        make.width.mas_offset(WidthScale(121));
        make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(121):HeightScale(121));
    }];
    [self.view addSubview:self.wintext];
    [self.wintext mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.winimage.mas_bottom).offset(WidthScale(30));
        make.centerX.equalTo(self.view);
        [self.wintext setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    }];
    [self.view addSubview:self.xqwin];
    [self.xqwin mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.wintext.mas_bottom).offset(WidthScale(40));
        make.centerX.equalTo(self.wintext);
        [self.xqwin setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    }];
    [self.view addSubview:self.check];
    [self.check mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.xqwin.mas_bottom).offset(WidthScale(10));
        make.centerX.equalTo(self.xqwin);
        make.width.mas_offset(WidthScale(165));
        make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(20):HeightScale(20));
    }];
    [self.view addSubview:self.time];
    [self.time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.check.mas_bottom).offset(WidthScale(50));
        make.centerX.equalTo(self.check);
        [self.time setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
    }];
    
    
}
-(UIImageView *)winimage
{
    if (!_winimage)
    {
        _winimage =[[UIImageView alloc]init];
        _winimage.image =[UIImage imageNamed:@"gougou"];
    }
    return _winimage;
}
-(UILabel *)wintext
{
    if (!_wintext)
    {
        _wintext =[[UILabel alloc]init];
        _wintext.text = @"支付成功";
        _wintext.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _wintext.font =[UIFont systemFontOfSize:WidthScale(20)];
    }
    return _wintext;
}
-(UILabel *)xqwin
{
    if (!_xqwin)
    {
        _xqwin =[[UILabel alloc]init];
        _xqwin.text = @"订单详情请到";
        _xqwin.textColor = [UIColor colorWithHexString:@"#999999"];
        _xqwin.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _xqwin;
}
-(UIButton *)check
{
    if (!_check)
    {
        _check =[[UIButton alloc]init];
        [_check setTitle:@"“我的-我的订单”中查看" forState:0];
        _check.titleLabel.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _check;
}
-(UILabel *)time
{
    if (!_time)
    {
        _time =[[UILabel alloc]init];
        _time.text = @"5秒之后自动跳转......";
        _time.textColor = [UIColor colorWithHexString:@"#999999"];
        _time.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _time;
}
@end
